function Table(id) {
	this.id = id;
	this.tableObj = document.getElementById(id);
	
	this.heads = new Array();
	this.captions = new Array();
	this.columns = new Array();

	this.dataStartRow = 0;
	this.rowLength = this.tableObj.rows.length;
	this.columnLength = this.tableObj.rows[0].cells.length;
	
	this.paramPrefix = (this.tableObj.getAttribute("parameterPrefix") != null)?this.tableObj.getAttribute("parameterPrefix"):"globe";
	
	//获取所有表头对象
	if (this.tableObj.rows[0].cells[0].tagName == "TH") {
		for (var i = 0; i < this.columnLength; i++) {
			this.heads[this.heads.length] = this.tableObj.rows[0].cells[i];
		}
		this.dataStartRow = 1;
		this.rowLength--;
	}
	
	//行的背景
	this.rowBgs = (this.tableObj.getAttribute("rowBgColor") != null)?this.tableObj.getAttribute("rowBgColor").split(","):null;
	//获取数据列td
	for (var i = 0; i < this.columnLength; i++) {
		var c = this.tableObj.rows[0].cells[i].getAttribute("captions");
		if (!c) c = this.tableObj.rows[0].cells[i].innerText;
		this.captions[this.captions.length] = c;
		
		var col = [];
		for (var j = 0; j < this.rowLength; j++) {
			if (i == 0 && this.rowBgs != null) {
				this.tableObj.rows[j+this.dataStartRow].bgColor = this.rowBgs[j%this.rowBgs.length];
			}
			col[col.length] = this.tableObj.rows[j+this.dataStartRow].cells[i];
		}
		this.columns[this.columns.length] = col;
	}
	
 	//初始化排序数据
 	this.action = this.tableObj.getAttribute("action");
 	this.orderKey = this.paramPrefix + ".order";
 	this.noCompositeOrder = (this.tableObj.getAttribute("noCompositeOrder") != null);
 	this.orderDisplays = new Array();
 	this.orderKeys = new Array();
 	this.orderSorts = new Array();
 
 	for (var i = 0; i < this.heads.length; i++) {
 		//初始化排序的相关数组
 		if (this.heads[i].getAttribute("order") != null) {
 			this.orderDisplays[this.orderDisplays.length] = this.captions[i];
 			this.orderKeys[this.orderKeys.length] = this.heads[i].getAttribute("order");
 			this.orderSorts[this.orderSorts.length] = "none";
 		} else continue;
 		
 		//当前requset中提起参数
 		if (!isValid(request)) continue;
 		var orderParams = request.getParameter(this.orderKey);
 		if (!isValid(orderParams)) continue;
 		orderParams = orderParams.split(",");
 								
		for (var j = 0; j < orderParams.length; j++) {
			var ts = orderParams[j].split(" ");
			//有关于该列的排序
			if (this.heads[i].getAttribute("order") == ts[0]) {
				if (ts[1] == 'asc') {
					this.heads[i].setAttribute("sort", "asc");
					this.orderSorts[this.orderSorts.length-1] = "asc";
					this.heads[i].insertAdjacentHTML("beforeEnd", "<img src=\""+globeWebAppContext+"/brick/image/up.gif\" width=\"14\" height=\"14\">");
				} else if (ts[1] == 'desc') {
					this.heads[i].setAttribute("sort", "desc");
					this.orderSorts[this.orderSorts.length-1] = "desc";
					this.heads[i].insertAdjacentHTML("beforeEnd", "<img src=\""+globeWebAppContext+"/brick/image/down.gif\" width=\"14\" height=\"14\">");
				}
			}
		}
	}

 	
 	
 	//导出的一些参数
 	this.exportTarget = (this.tableObj.getAttribute("exportTarget") != null)?this.tableObj.getAttribute("exportTarget"):"_self";
 	this.canExport = (this.tableObj.getAttribute("canExport") != null);
 	
 	//初始化翻页数据
 	this.noPager = (this.tableObj.getAttribute("noPager") != null);
 	this.noPageSize = (this.tableObj.getAttribute("noPageSize") != null);
 	this.pagerBeforeTable = (this.tableObj.getAttribute("beforePager") != null);
 	this.pagerAfterTable = !(this.tableObj.getAttribute("afterPager") == "no");
 	this.bpager = null;
 	this.apager = null;
 	this.pageSizeKey = this.paramPrefix + ".pagesize";
 	this.pageNoKey = this.paramPrefix + ".pageno";
 	this.rowCountKey = this.paramPrefix + ".rowcount";
 	this.pageSize = (this.tableObj.getAttribute("pageSize") != null)?new Number(this.tableObj.getAttribute("pageSize")):10;
 	this.pageNo = (this.tableObj.getAttribute("pageNo") != null)?new Number(this.tableObj.getAttribute("pageNo")):1;
 	this.pageCount = (this.tableObj.getAttribute("pageCount") != null)?new Number(this.tableObj.getAttribute("pageCount")):-1;
 	this.rowCount = (this.tableObj.getAttribute("rowCount") != null)?new Number(this.tableObj.getAttribute("rowCount")):-1;
 	this.pagerWidth = (this.tableObj.getAttribute("pagerWidth") != null)?this.tableObj.getAttribute("pagerWidth"):"100%";
 	if (this.pagerBeforeTable && !this.noPager) {
	 	this.bpager = new Pager(this.id+".before", this.pagerWidth);
		this.bpager.needPageSize = !this.noPageSize
		this.bpager.pageSizeKey = this.pageSizeKey;
		this.bpager.pageNoKey = this.pageNoKey;
		this.bpager.rowCountKey = this.rowCountKey;
		this.bpager.pageSize = this.pageSize;
		this.bpager.pageNo = this.pageNo;
		this.bpager.pageCount = this.pageCount;
		this.bpager.rowCount = this.rowCount;
		this.bpager.action = this.action;
		this.tableObj.insertAdjacentHTML("beforeBegin", this.bpager.build());
		this.bpager.addEvent();
 	}
 	if (this.pagerAfterTable && !this.noPager) {
	 	this.apager = new Pager(this.id+".after", this.pagerWidth);
		this.apager.needPageSize = !this.noPageSize
		this.apager.pageSizeKey = this.pageSizeKey;
		this.apager.pageNoKey = this.pageNoKey;
		this.apager.rowCountKey = this.rowCountKey;
		this.apager.pageSize = this.pageSize;
		this.apager.pageNo = this.pageNo;
		this.apager.pageCount = this.pageCount;
		this.apager.rowCount = this.rowCount;
		this.apager.action = this.action;
		this.tableObj.insertAdjacentHTML("afterEnd", this.apager.build());
		this.apager.addEvent();
 	}
 	
 	
 	var oThis = this;
 	//初始化右键菜单事件
 	ContextMenu.intializeContextMenu();
 	for (var i = 0; i < this.heads.length; i++) {
 		var thObj = this.heads[i];
 		thObj.oncontextmenu = function (event) {
 			oThis.showMenu(this);
 		}
 	}
 	
	//不需要能够调整列宽
	this.noResizeWidth = (this.tableObj.getAttribute("noResizeWidth") != null);
	//可以调整列宽，初始化一些信息
	this.bordering = false;
	this.border = 2;
	this.resizing = false;
	this.oldThWidth = 0;
	this.nowThObj = null;
	this.xPosition = 0;
	this.minThWidth = 50;
	this.allWidth = 0;
	if (!this.noResizeWidth) {
		//将列宽初始化于th上
		if (isValid(this.tableObj.width)) this.tableObj.width = "";
		for (var i = 0; i < this.heads.length; i++) {
			var thObj = this.heads[i];
			//设定宽度
			if (!isValid(thObj.width)) thObj.width = "100";
			this.allWidth += new Number(thObj.width);
			//增加相应的事件
			thObj.onmousemove = function (event) {
				oThis.resizeCursorSet(event, this);
			}
			thObj.onmouseout = function (event) {
				oThis.resizeCursorRestore(event, this);
			}
			thObj.onmousedown = function (event) {
				oThis.resizeDragStart(event, this);
			}
		}
		
		if (this.apager != null) this.apager.getPagerObject().style.width = this.allWidth;
		if (this.bpager != null) this.bpager.getPagerObject().style.width = this.allWidth;
	}
}
Table.prototype.showMenu = function (thObj) {
	var index = this.indexOf(thObj);
	var noMoveRight = (index == this.columnLength-1);
	var noMoveLeft = (index == 0);
	var caption = this.captions[index];
	var order = thObj.getAttribute("order");
	var noHide = (thObj.getAttribute("noHide") != null);
	var noMove = (thObj.getAttribute("noMove") != null);
	
	var oThis = this;
	var popupoptions = [
   			new ContextItem("<img src=\""+globeWebAppContext+"/brick/image/up.gif\" width=\"12\" height=\"12\">&nbsp;升序", function() { oThis.headOrder(order, "asc"); }, (order == null)),
			new ContextItem("<img src=\""+globeWebAppContext+"/brick/image/down.gif\" width=\"12\" height=\"12\">&nbsp;降序", function() { oThis.headOrder(order, "desc"); }, (order == null)),
			new ContextItem("去除排序", function() { oThis.removeHeadOrder(); }, (order == null)),
			new ContextItem("复合排序", function() { oThis.goCompositeOrderPage(); }, this.noCompositeOrder),
			new ContextSeperator(),
   			new ContextItem("<img src=\""+globeWebAppContext+"/brick/image/back.gif\" width=\"12\" height=\"12\">&nbsp;左移", function() { oThis.moveLeft(index); }, noMoveLeft||noMove),
   			new ContextItem("<img src=\""+globeWebAppContext+"/brick/image/forward.gif\" width=\"12\" height=\"12\">&nbsp;右移", function() { oThis.moveRight(index); }, noMoveRight||noMove),
			new ContextSeperator(),
			new ContextItem("列表导出", function() { oThis.goExportPage(); }, !this.canExport),
			new ContextSeperator(),
			new ContextItem("<img src=\""+globeWebAppContext+"/brick/image/remove.gif\" width=\"12\" height=\"12\">&nbsp;隐藏列["+caption+"]", function() { oThis.hideColumn(index); }, noHide)
	];
	for (var i = 0; i < this.heads.length; i++) {
		if (this.heads[i].style.display == "none") {
			eval("var item = new ContextItem(\"<img src='"+globeWebAppContext+"/brick/image/add.gif' width='12' height='12'>&nbsp;显示列["+this.captions[i]+"]\", function() {var tIndex = "+i+"; oThis.showColumn(tIndex);});");
			popupoptions[popupoptions.length] = item;
		}
 	}
	ContextMenu.display(popupoptions);
};

//排序相关方法
Table.prototype.headOrder = function (odr, aod) {
	var orderStr = odr + " " + aod;
	tableLib.goOrder(orderStr, this.orderKey, this.action);
};
Table.prototype.removeHeadOrder = function () {
	tableLib.goOrder("", this.orderKey, this.action);
};
Table.prototype.compositeOrder = function (odrs, aods) {
	if (typeof odrs == 'object' && typeof aods == 'object' && odrs.length == aods.length) {
		var orderStr = "";
		for (i = 0; i < odrs.length; i ++) {
			orderStr += "," + odrs[i] + " " + aods[i];
		}
		if (orderStr.length != 0) orderStr = orderStr.substring(1);
		tableLib.goOrder(orderStr, this.orderKey, this.action);
	}
};
Table.prototype.goCompositeOrderPage = function () {
	var url = globeWebAppContext + "/brick/order.jsp?tableId=" + this.id;
	openDialog(url, 400, 400);
}

//导出相关方法
Table.prototype.exportData = function (start, end) {
	var display = "";
	var key = "";
	for (var i = 0; i < this.heads.length; i++) {
		if (this.heads[i].style.display == "none") continue;
		if (this.heads[i].getAttribute("export") != null) {
			key += "," + this.heads[i].getAttribute("export");
			display += "," + this.captions[i];
		}
	}
	if (key == "" && display == "") {
		alert("没有可以导出的列");
	} else {
		key = key.substring(1);
		display = display.substring(1);
		tableLib.exportPage(start, end, key, display, this.pageSize, this.pageNoKey, this.pageSizeKey, this.action, this.exportTarget);
	}
}

Table.prototype.goExportPage = function () {
	var url = globeWebAppContext + "/brick/export.jsp?tableId=" + this.id;
	openDialog(url, 350, 150);
}

//移动相关方法
Table.prototype.moveLeft = function (index) {
	if (index == 0) return;
	var thObj = this.heads[index];
	
	//换dtml对象
	thObj.swapNode(this.heads[index - 1]);
	for (var i = 0; i < this.columns[index].length; i++) {
		this.columns[index][i].swapNode(this.columns[index - 1][i]);
	}
	
	
	//换变量
	this.heads.swap(index, index - 1);
	this.captions.swap(index, index - 1);
	this.columns.swap(index, index - 1);
};
Table.prototype.moveRight = function (index) {
	if (index == this.columnLength-1) return;
	var thObj = this.heads[index];
	
	//换dtml对象
	thObj.swapNode(this.heads[index + 1]);
	for (var i = 0; i < this.columns[index].length; i++) {
		this.columns[index][i].swapNode(this.columns[index + 1][i]);
	}
	
	//换变量
	this.heads.swap(index, index + 1);
	this.captions.swap(index, index + 1);
	this.columns.swap(index, index + 1);
};
Table.prototype.indexOf = function (thObj) {
	for (var i = 0; i < this.heads.length; i++) {
		if (this.heads[i] == thObj) return i;
	}
	return -1;
};
//隐藏相关方法
Table.prototype.showColumn = function (index) {
	if (this.heads.length != 0) {
		this.heads[index].style.display = "block";
	}
	
	var col = this.columns[index];
	for (var i = 0; i < col.length; i++) {
		col[i].style.display = "block";
	}
};

Table.prototype.hideColumn = function (index) {
	if (this.heads.length != 0) {
		this.heads[index].style.display = "none";
	}
	
	var col = this.columns[index];
	for (var i = 0; i < col.length; i++) {
		col[i].style.display = "none";
	}
};
Table.prototype.resizeCursorSet = function (event, thObj) {
	var e = (event)?event:window.event;
	var target = (e.srcElement)?e.srcElement:e.target;
	var x;

	if (target != thObj) return;
	
	if (document.all) {
		x = e.offsetX;
	} else {
		x = e.layerX;
	}
	
	var resizeDir = "";
	if (x >= parseInt(thObj.width) - 2*this.border) {
		this.bordering = true;
		resizeDir += "e-resize";
	} else {
		this.bordering = false;
	}
	
	if (document.all)
		document.body.style.cursor = resizeDir;
	else
		thObj.style.cursor = resizeDir;
};
Table.prototype.resizeCursorRestore = function (event, thObj) {
	this.bordering = false;
	if (document.all)
    	document.body.style.cursor = "";
	else
    	thObj.style.cursor = "";
};
Table.prototype.resizeDragStart = function (event, thObj) {
	if (!this.bordering) return;
	
	var e = (event)?event:window.event;
	var target = (e.srcElement)?e.srcElement:e.target;
	var x;
	
	if (target != thObj) return;
	
	// Save th size.
	this.oldThWidth = parseInt(thObj.width);
	this.nowThObj = thObj;
	
	// Save cursor position.
  	if (document.all) {
		this.xPosition = e.x;
	} else {
		this.xPosition = e.pageX;
	}
	
  	//Set document to capture mousemove and mouseup events.	
  	var oThis = this;
	var ro = function (event) {
		oThis.resizeDragOn(event);
	};
	var rs = function (event) {
		oThis.resizeDragStop(event);
	};
	if (document.all) {
		document.attachEvent("onmousemove", ro);
		document.attachEvent("onmouseup", rs);
	} else {
		document.addEventListener("mousemove", ro, true);
		document.addEventListener("mouseup", rs, true);
		e.preventDefault();
	}
	this.resizing = true;
};
Table.prototype.resizeDragOn = function (event) {
	if (!this.resizing) return;
	
	var e = (event)?event:window.event;
	var dx;
	var thObj = this.nowThObj;
	
	if (document.all) {
		dx = e.x - this.xPosition;
	} else {
		dx = e.pageX - this.xPosition;
	}
	var wx = (this.oldThWidth + dx <= this.minThWidth)?this.minThWidth:this.oldThWidth + dx;
	dx = wx - this.oldThWidth;
	thObj.width = wx;
	
	if (this.apager != null) this.apager.getPagerObject().style.width = this.allWidth + dx;
	if (this.bpager != null) this.bpager.getPagerObject().style.width = this.allWidth + dx;

	if (document.all) {
    	e.cancelBubble = true;
    	e.returnValue = false;
    } else
    	e.preventDefault();
};
Table.prototype.resizeDragStop = function (event) {
	this.resizing = false;
	var oThis = this;
	var thObj = this.nowThObj;
	this.allWidth = 0;
	for (var i = 0; i < this.heads.length; i++) {
		this.allWidth += new Number(this.heads[i].width);
	}
	var ro = function (event) {
		oThis.resizeDragOn(event);
	};
	var rs = function (event) {
		oThis.resizeDragStop(event);
	};
	if (document.all) {
		document.detachEvent("onmousemove", ro);
		document.detachEvent("onmouseup", rs);
	} else {
		document.removeEventListener("mousemove", ro, true);
		document.removeEventListener("mouseup", rs, true);
		event.preventDefault();
	}
};



//翻页器的对象
function Pager(id, width, paramPrefix) {
	this.id = id;
	
	//是否需要控制每页大小
	this.needPageSize = true;
	if (isValid(paramPrefix)) {
		this.pageSizeKey = paramPrefix + ".pagesize";
		this.pageNoKey = paramPrefix + ".pageno";
		this.rowCountKey = paramPrefix + ".rowcount";
	} else {
		this.pageSizeKey = "globe.pagesize";
		this.pageNoKey = "globe.pageno";
		this.rowCountKey = "globe.rowcount";
	}
	this.pageSize = 10;
	this.pageNo = 1;
	//如果总页数和总记录数为空,则不显示
	this.pageCount = -1;
	this.rowCount = -1;
	//提交的action
	this.action = null;
	
	this.width = (width)?width:"100%";
}

Pager.prototype.build = function () {
	var html = "";
	html += "<div id=\""+this.id+"\" class=\"pager_div\" style=\"width:"+this.width+"\"><ul>";
	if (this.pageCount != -1 && this.rowCount != -1)
		html += "<li"+((this.pageNo<=1)?" style=\"filter:gray();\"":"")+"><img id=\""+this.id+".first\" src=\""+globeWebAppContext+"/brick/image/first.gif\" class=\"pager_arrow\" align=\"left\" title=\"首页\" "+((this.pageNo<=1)?"disabled":"")+"/></li>";
	html += "<li"+((this.pageNo<=1)?" style=\"filter:gray();\"":"")+"><img id=\""+this.id+".previous\" src=\""+globeWebAppContext+"/brick/image/previous.gif\" class=\"pager_arrow\" align=\"left\" title=\"上一页\" "+((this.pageNo<=1)?"disabled":"")+"/></li>";
	html += "<li"+((this.pageNo>=this.pageCount)?" style=\"filter:gray();\"":"")+"><img id=\""+this.id+".next\" src=\""+globeWebAppContext+"/brick/image/next.gif\" class=\"pager_arrow\" align=\"left\" title=\"下一页\" "+((this.pageNo>=this.pageCount)?"disabled":"")+"/></li>";
	if (this.pageCount != -1 && this.rowCount != -1)
		html += "<li"+((this.pageNo>=this.pageCount)?" style=\"filter:gray();\"":"")+"><img id=\""+this.id+".last\" src=\""+globeWebAppContext+"/brick/image/last.gif\" class=\"pager_arrow\" align=\"left\" title=\"末页\" "+((this.pageNo>=this.pageCount)?"disabled":"")+"/></li>";
	
	html += "</ul><ul>";
	html += "<li style=\"float:right;margin-top:0px;\">";
	html += "第<input id=\""+this.id+".pageno\" style=\"width:20px\" value=\""+this.pageNo+"\"/>页";
	if (this.needPageSize) {
		html += "/每页<select id=\""+this.id+".pagesize\" style=\"width:40px\">";
		html += "<option value=\"10\" "+((this.pageSize==10)?"selected":"")+" />10";
		html += "<option value=\"20\" "+((this.pageSize==20)?"selected":"")+" />20";
		html += "<option value=\"50\" "+((this.pageSize==50)?"selected":"")+" />50";
		html += "<option value=\"100\" "+((this.pageSize==100)?"selected":"")+" />100";
		html += "</select>";
	}
	if (this.pageCount != -1 && this.rowCount != -1)
		html += "/共"+this.pageCount+"页"+this.rowCount+"条";
	html += "</li></ul></div>";
	return html;
};

Pager.prototype.write = function () {
	document.write(this.build());
	this.addEvent();
};
Pager.prototype.getPageNoObject = function () {
	return document.getElementById(this.id + ".pageno");
};
Pager.prototype.getPageSizeObject = function () {
	if (this.needPageSize)
		return document.getElementById(this.id + ".pagesize");
	else
		return null;
};
Pager.prototype.getPagerObject = function () {
	return document.getElementById(this.id);
};
Pager.prototype.getFirstObject = function () {
	if (this.pageCount != -1 && this.rowCount != -1)
		return document.getElementById(this.id + ".first");
	else
		return null;
};
Pager.prototype.getLastObject = function () {
	if (this.pageCount != -1 && this.rowCount != -1)
		return document.getElementById(this.id + ".last");
	else
		return null;
};
Pager.prototype.getNextObject = function () {
	return document.getElementById(this.id + ".next");
};
Pager.prototype.getPreviousObject = function () {
	return document.getElementById(this.id + ".previous");
};
Pager.prototype.addEvent = function () {
	var oThis = this;
	//pagesize onchange事件
	var o = this.getPageSizeObject();
	if (isValid(o)) {
		o.onchange = function () {
			var ps = this.value;
			tableLib.goPage(oThis.pageNo, ps, oThis.rowCount, oThis.pageNoKey, oThis.pageSizeKey, oThis.rowCountKey, oThis.action);
		};
	}
	
	//pageno return事件
	o = this.getPageNoObject();
	if (isValid(o)) {
		o.onkeydown = function () {
			//回车
			if (event.keyCode == 13) {
				var pn = this.value;
				if (isPositiveInt(pn)) {
					pn = new Number(pn);
					if (oThis.pageCount != -1 && oThis.pageCount < pn) pn = oThis.pageCount;
					if (pn < 1) pn = 1;
					tableLib.goPage(pn+"", oThis.pageSize, oThis.rowCount, oThis.pageNoKey, oThis.pageSizeKey, oThis.rowCountKey, oThis.action);
				} else 
					alert("请输入正整数作为页码");
			}
		};
	}
	
	//button 点击事件
	o = this.getFirstObject();
	if (isValid(o)) {
		o.onclick = function () {
			tableLib.goPage("1", oThis.pageSize, oThis.rowCount, oThis.pageNoKey, oThis.pageSizeKey, oThis.rowCountKey, oThis.action);
		};
	}
	o = this.getLastObject();
	if (isValid(o)) {
		o.onclick = function () {
			tableLib.goPage(oThis.pageCount+"", oThis.pageSize, oThis.rowCount, oThis.pageNoKey, oThis.pageSizeKey, oThis.rowCountKey, oThis.action);
		};
	}
	o = this.getNextObject();
	if (isValid(o)) {
		o.onclick = function () {
			tableLib.goPage((oThis.pageNo + 1)+"", oThis.pageSize, oThis.rowCount, oThis.pageNoKey, oThis.pageSizeKey, oThis.rowCountKey, oThis.action);
		};
	}
	o = this.getPreviousObject();
	if (isValid(o)) {
		o.onclick = function () {
			tableLib.goPage((oThis.pageNo - 1)+"", oThis.pageSize, oThis.rowCount, oThis.pageNoKey, oThis.pageSizeKey, oThis.rowCountKey, oThis.action);
		};
	}
};

//翻页和提交排序的包
var tableLib = {
	goOrder:		function (s, key, action) {
		if (isValid(request)) {
			var req = request.clone();
			req.setParameters(key, s);
			if (isValid(action))
				buildFormPost(action + "?" + req.toQueryString(), "_self", "order");
			else
				buildFormPost(req.toURL(), "_self", "order");
		}
	},
	
	goPage:			function (n, s, r, nk, sk, rk, action) {
		if (isValid(request)) {
			var req = request.clone();
			req.setParameters(nk, n);
			req.setParameters(sk, s);
			if (r != -1) req.setParameters(rk, r);
			if (isValid(action))
				buildFormPost(action + "?" + req.toQueryString(), "_self", "pager");
			else
				buildFormPost(req.toURL(), "_self", "pager");
		}
	},
	
	exportPage:		function (n, e, key, display, s, nk, sk, action, target) {
		if (isValid(request)) {
			var req = request.clone();
			req.setParameters(nk, n);
			req.setParameters(nk+".endpageno", e);
			req.setParameters(sk, s);
			req.setParameters("globe.export.key", key);
			req.setParameters("globe.export.display", display);
			if (isValid(action))
				buildFormPost(action + "?" + req.toQueryString(), target, "export");
			else
				buildFormPost(req.toURL(), target, "export");
		}
	}
};